#include<stdio.h>
#include<math.h>
#include<time.h>
int main()
{
   srand((unsigned)time(NULL));
   int i,j,a[100],max1,min1;
   float aver1,aver2,max2,min2,m,n,b[100];
   aver1=0;aver2=0;m=0;n=0;
   for(i=0;i<100;i++)
   {
      a[i]=rand()%100;
      if(a[i]==0)
      {
         b[i]=0; 
      }
      else
      {
         b[i]=1.0/a[i];
      }
      m=(aver1+a[i]);n=(aver2+b[i]);  
      printf("%d %d %f\n",i+1,a[i],b[i]);
   }
   aver1=m/100;aver2=n/100; 
   max1=a[0];min1=a[0];max2=b[0];min2=b[0];
   for(j=0;j<100;j++)
   {
      if(max1<a[j]){max1=a[j];}
      if(min1>a[j]){min1=a[j];}
      if(max2<b[j]){max2=b[j];}
      if(min2>b[j]){min2=b[j];}  
   }
   printf("max %d %f\n",max1,max2);
   printf("min %d %f\n",min1,min2);
   printf("aver %f %f\n",aver1,aver2);
   return 0;
}
